<template>
  <div>
    <el-card>
      <el-button type="primary" size="small" @click="handleClick">修改班级</el-button>
      <el-button type="primary" size="small" @click="handleClick_pwd">修改密码</el-button>
    </el-card>
    <el-form ref="form" :model="personalInfo" label-position="left">
      <el-form-item label="姓名：" prop="studentName">
        {{ personalInfo.studentName }}
      </el-form-item>
      <el-form-item label="学号：" prop="studentNum">
        {{ personalInfo.studentNum }}
      </el-form-item>
      <el-form-item label="班级：" prop="stuClass">
        {{ personalInfo.stuClass }}
      </el-form-item>
    </el-form>
  </div>
<!--  <el-table-->
<!--    :data="tableData"-->
<!--    border-->
<!--    style="width: 100%"-->
<!--  >-->
<!--    <el-table-column-->
<!--      fixed-->
<!--      prop="student_name"-->
<!--      label="姓名"-->
<!--      width="150"-->
<!--    />-->
<!--    <el-table-column-->
<!--      prop="student_num"-->
<!--      label="学号"-->
<!--      width="120"-->
<!--    />-->
<!--    <el-table-column-->
<!--      prop="stu_class"-->
<!--      label="班级"-->
<!--      width="120"-->
<!--    />-->
<!--    <el-table-column-->
<!--      prop="pwd"-->
<!--      label="密码"-->
<!--      width="120"-->
<!--    />-->
<!--    <el-table-column-->
<!--      fixed="right"-->
<!--      label="修改信息"-->
<!--      width="100"-->
<!--    >-->
<!--      <template slot-scope="scope">-->
<!--        <el-button type="text" size="small" @click="handleClick(scope.row)">修改班级</el-button>-->
<!--        <el-button type="text" size="small" @click="handleClick_pwd(scope.row)">修改密码</el-button>-->
<!--      </template>-->
<!--    </el-table-column>-->
<!--  </el-table>-->
</template>
<script>
import { getInfo } from '../../api/user'
export default {
  components: {},
  data() {
    return {
      tableData: [],
      personalInfo: {
        studentNum: '',
        studentName: '',
        stuClass: ''

      }
    }
  },
  created() {
    this.getDetail()
  },
  methods: {
    getDetail() {
      getInfo().then(res => {
        // this.tableData = res.data.list
        this.personalInfo = res.data
      }).catch(err => {
        this.$message.error('请求失败！')
      })
    },
    handleClick() {
      this.$router.push({ path: '/personal/Update'})
    },
    handleClick_pwd() {
      this.$router.push({ path: '/personal/UpdatePwd'})
    }

  }
}
</script>
<style scoped></style>
